<?php 
// echo '<script type="text/javascript" src="'.$path.'/kcfinder.js'.'"></script>'; ?>
<script type="text/javascript">

function openKCFinder<?php echo $fieldName?>(field) {
    window.KCFinder = {
        callBack: function(url) {
            field.value = url;
            window.KCFinder = null;
        }
    };
    window.open('<?php echo Yii::app()->request->baseUrl; ?>/kcfinder/browse.php?type=<?php echo $type;?>&lang=vi', 'kcfinder_textbox',
        'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
        'resizable=1, scrollbars=0, width=800, height=600'
    );
}

</script>
<input class="span2" size="60" type="text" id="<?php echo get_class($model).'_'.$fieldName; ?>" 
	name="<?php echo get_class($model).'['.$fieldName.']'; ?>" value="<?php echo $model->$fieldName;?>" />
<input type="button" class="btn" value="Select File" onclick="openKCFinder<?php echo $fieldName?>(<?php echo get_class($model).'_'.$fieldName; ?>);" />